package cn.com.djin.ssm.entity;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
 * 
 * @author djin
 * 购物车实体类
 * 
 */
@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })
public class Car extends BaseEntity{

	private static final long serialVersionUID = 1L;
	//购物车id
	private Integer cid;
	//生成时间
	@JsonFormat(pattern="yyyy/MM/dd",timezone="GMT+8")
	private Date makeCarDate;
	//商品数量
	private Integer cnum;
	//价格
	private double cprice;
	//商品id
	private Good good;
	//用户对象
	private User user;
	//颜色对象
	private GoodColor goodColor;
	//尺寸对象
	private GoodSize goodSize;
	//失效时间
	private Date endCarDate;
	//状态
	private Integer cstate;
	private String cstateStr;
	
	public Good getGood() {
		return good;
	}
	public void setGood(Good good) {
		this.good = good;
	}
	public double getCprice() {
		return cprice;
	}
	public void setCprice(double cprice) {
		this.cprice = cprice;
	}
	public Integer getCnum() {
		return cnum;
	}
	public void setCnum(Integer cnum) {
		this.cnum = cnum;
	}
	public Date getMakeCarDate() {
		return makeCarDate;
	}
	public void setMakeCarDate(Date makeCarDate) {
		this.makeCarDate = makeCarDate;
	}
	public Integer getCid() {
		return cid;
	}
	public void setCid(Integer cid) {
		this.cid = cid;
	}
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	public GoodColor getGoodColor() {
		return goodColor;
	}
	public GoodSize getGoodSize() {
		return goodSize;
	}
	public void setGoodColor(GoodColor goodColor) {
		this.goodColor = goodColor;
	}
	public void setGoodSize(GoodSize goodSize) {
		this.goodSize = goodSize;
	}
	public Date getEndCarDate() {
		return endCarDate;
	}
	public Integer getCstate() {
		return cstate;
	}
	public void setEndCarDate(Date endCarDate) {
		this.endCarDate = endCarDate;
	}
	public void setCstate(Integer cstate) {
		this.cstate = cstate;
	}
	public String getCstateStr() {
		if(this.cstate==0){
			this.cstateStr = "已失效";
		}else{
			this.cstateStr = "未失效";
		}
		return cstateStr;
	}
	public void setCstateStr(String cstateStr) {
		this.cstateStr = cstateStr;
	}
	@Override
	public String toString() {
		return "Car [cid=" + cid + ", makeCarDate=" + makeCarDate + ", cnum=" + cnum + ", cprice=" + cprice + ", good="
				+ good + ", user=" + user + ", goodColor=" + goodColor + ", goodSize=" + goodSize + ", endCarDate="
				+ endCarDate + ", cstate=" + cstate + "]";
	}
	
}
